import { observable, action, get, set, remove, has } from 'mobx'

export default class DataStore {
  @observable data = {}

  @action
  set = (key, value) => {
    set(this.data, key, value)
  }

  @action
  remove = key => {
    remove(this.data, key)
  }

  has = key => {
    return has(this.data, key)
  }

  get = key => {
    return get(this.data, key)
  }

  clear = () => {
    this.data.clear()
  }
}
